package com.rightsidetech.system.mapper;

import com.rightsidetech.system.dtos.request.SysUserReq;
import com.rightsidetech.system.dtos.response.LoginResp;
import com.rightsidetech.system.dtos.response.SysUserResp;
import com.rightsidetech.system.entity.SysUserLoginHistory;
import com.rightsidetech.system.entity.SysUserLoginInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserLoginInfoMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUserLoginInfo record);

    int insertSelective(SysUserLoginInfo record);

    SysUserLoginInfo selectByPrimaryKey(Long id);

    String selectLoginName(Long id);

    int updateByPrimaryKeySelective(SysUserLoginInfo record);

    int updateByPrimaryKey(SysUserLoginInfo record);

    SysUserLoginInfo selectByToken(String tokenCompany);

    SysUserLoginInfo selectByLoginName(@Param("loginName") String loginName);

    int updateIsDeletedInt(@Param("isDeleted") Byte isDeleted,@Param("id") Long id);

    List<SysUserResp> selectSysUserList(@Param("req")SysUserReq sysUserReq,@Param("type")Long type) throws Exception;
    Long selectSysUserList_COUNT(@Param("req")SysUserReq sysUserReq,@Param("type")Long type) throws Exception;

    SysUserLoginHistory selectLoginByToken(@Param("token") String token);

    int updateToken(@Param("id") Long id, @Param("token") String token);

    LoginResp selectLoginResDate(String token);

    SysUserLoginInfo selectLoginInfoByToken(String token);

    int updateLogout(String token);

    int selectAreaId(Long areaId);

    SysUserResp selectById(Long id);

    List<SysUserLoginInfo> findByAreaId(@Param("areaId") Long areaId);

    int tokenNull(Long id);
}